package com.shuhua.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.shuhua.pojo.vo.UserInfo; // 1. 引入 UserInfo 接口
import lombok.Data;

import java.io.Serializable; // 2. 建议引入 Serializable
import java.util.Date;

/**
 * 工匠/技师实体类
 */
@Data
@TableName("craftsman")
public class Craftsman implements Serializable, UserInfo {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String username;

    private String password;

    @TableField("real_name")
    private String realName;

    private String phone;

    private String avatar;

    @TableField("service_city")
    private String serviceCity;

    @TableField("service_district")
    private String serviceDistrict;

    private String department;

    private String station;

    @TableField("is_team_leader")
    private Integer isTeamLeader;

    @TableField("is_company_craftsman")
    private Integer isCompanyCraftsman;

    @TableField("created_at")
    private Date createdAt;

    @TableField("updated_at")
    private Date updatedAt;

    @TableField("id_card_front")
    private String idCardFront;

    @TableField("id_card_back")
    private String idCardBack;

    @TableField("auth_status")
    private Integer authStatus;

    @TableField("auth_time")
    private Date authTime;

    @Override
    public String getUserType() {
        return "craftsman";
    }
}